<template>
  <van-nav-bar
      fixed
      title="投诉列表"
      left-text="返回"
      right-text="+投诉"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
  />
  <van-divider></van-divider>
  <van-divider></van-divider>
  <div v-for="item in list" :key="item">
    <van-cell :title="'订单号:'+item.order_id" :label="'投诉内容'+item.description" :value="item.status==0?'等待处理':'已处理'"/>
    <van-divider />
  </div>
  <van-pagination v-model="currentPage" :total-items="total" :items-per-page="15" @change="pageClick"/>
  <van-divider></van-divider>
</template>

<script>
import {complainList} from "@/api/complain";

export default {
  name: "ComplainList",
  data(){
    return {
      list:{},
      page:1,
      currentPage:1,
      total:0
    }
  },
  created() {
    complainList(this.page).then((res)=>{
      console.log(res)
      this.list = res.data.data
      this.currentPage = res.data.current_page
      this.total = res.data.total
    })
  },
  methods:{
    onClickLeft(){
      history.back()
    },
    onClickRight(){
      this.$router.push('/submit-complain')
    },
    pageClick(){

    }
  }
}
</script>

<style scoped>

</style>
